package com.ruoyi.zyx.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.ZyxDevice;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.zyx.domain.*;
import com.ruoyi.zyx.mapper.ZyxDeviceMapper;
import com.ruoyi.zyx.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 设备基础信息Controller
 *
 * @author lhs
 * @date 2021-05-26
 */
@RestController
@RequestMapping("/zyx/analyse")
public class ZyxAnalyseController extends BaseController
{
    @Autowired
    private IZyxDeviceService zyxDeviceService;
    @Autowired
    private IZyxMemberService zyxMemberService;
    @Autowired
    private IZyxTakecareService zyxTakecareService;
    @Autowired
    private IZyxCheckService zyxCheckService;
    @Autowired
    private IZyxAllotService zyxAllotService;

    @Autowired
    private IZyxRecordService zyxRecordService;
    /**
     * 设备故障统计
     */
    @GetMapping("/zyxDeviceFaultlist")
    public TableDataInfo zyxDeviceFaultlist(ZyxDevice zyxDevice)
    {
        startPage();
        List<ZyxDevice> list = zyxDeviceService.zyxDeviceFaultlist(zyxDevice);
        return getDataTable(list);
    }
    /**
     * 员工绩效统计
     */
    @GetMapping("/zyxMemberCreditlist")
    public TableDataInfo zyxMemberCreditlist(ZyxMember  zyxMember )
    {
        startPage();
        List<ZyxMember> list = zyxMemberService.zyxMemberCreditlist(zyxMember);
        return getDataTable(list);
    }
    /**
     * 设备费用统计
     */
    @GetMapping("/zyxDeviceCostlist")
    public TableDataInfo zyxDeviceCostlist(ZyxDevice zyxDevice)
    {
        startPage();
        List<ZyxDevice> list = zyxDeviceService.zyxDeviceCostlist(zyxDevice);
        return getDataTable(list);
    }
}
